package com.zingrow.web.report.response;

import java.io.Serializable;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonIgnore;

/**
 * 模块数据基类,用于维度数据扩展
 * 
 * @author sywd
 *
 */
public abstract class BaseData implements Serializable, Comparable<BaseData> {
    private static final long serialVersionUID = 3447072604135269913L;
    private Long id;
    /**
     * 来源
     */
    private String sourceName;
    /**
     * 第一个数字
     */
    private Integer firstNum;
    /**
     * 第二个数字
     */
    private Integer secondNum;
    /**
     * 第三个数字
     */
    private Integer thirdNum;
    /**
     * 统计时间
     */
    private Date time;

    public String getSourceName() {
        return sourceName;
    }

    public void setSourceName(String sourceName) {
        this.sourceName = sourceName;
    }

    public Integer getFirstNum() {
        return firstNum;
    }

    public void setFirstNum(Integer firstNum) {
        this.firstNum = firstNum;
    }

    public Integer getSecondNum() {
        return secondNum;
    }

    public void setSecondNum(Integer secondNum) {
        this.secondNum = secondNum;
    }

    public Date getTime() {
        return time;
    }

    public void setTime(Date time) {
        this.time = time;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Integer getThirdNum() {
        return thirdNum;
    }

    public void setThirdNum(Integer thirdNum) {
        this.thirdNum = thirdNum;
    }

    @JsonIgnore
    public boolean isEmpty() {
        if ((firstNum != null && firstNum > 0) || (secondNum != null && secondNum > 0)
                || (thirdNum != null && thirdNum > 0)) {
            return false;
        }
        return true;
    }

}
